//
//  ArtCeilingView.m
//  test02
//
//  Created by lzh on 2021/3/12.
//  Copyright © 2021 NO. All rights reserved.
//

#import "ArtCeilingView.h"
#import <Masonry.h>
@interface ArtCeilingView()
@property(nonatomic,strong)UIButton  * propertiesBtn;//目录
@property(nonatomic,strong)UIButton  * introductionBtn;//简介
@property(nonatomic,strong)UIView  * propertiesLine;//目录红线
@property(nonatomic,strong)UIView  * introductionLine;//简介红线

@end

@implementation ArtCeilingView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self makeUI];
    }
    return self;
}
-(void)makeUI{
    self.backgroundColor = [UIColor blueColor];
    [self addSubview:self.propertiesBtn];
    [self addSubview:self.introductionBtn];
    [self addSubview:self.propertiesLine];
    [self addSubview:self.introductionLine];
    [self.propertiesBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self).offset(-(self.bounds.size.width/4.0));
        make.centerY.equalTo(self);
        make.height.mas_offset(23);
    }];
    
    [self.propertiesLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.propertiesBtn);
        make.top.equalTo(self.propertiesBtn.mas_bottom);
        make.height.mas_offset(2);
        make.width.mas_offset(15);
       }];
    
    [self.introductionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(self).offset(self.bounds.size.width/4.0);
          make.centerY.equalTo(self);
          make.height.mas_offset(23);
      }];
      
      [self.introductionLine mas_makeConstraints:^(MASConstraintMaker *make) {
          make.centerX.equalTo(self.introductionBtn);
          make.top.equalTo(self.introductionBtn.mas_bottom);
          make.height.mas_offset(2);
          make.width.mas_offset(15);
     }];
    
}
-(UIButton *)propertiesBtn{
    
    if (!_propertiesBtn) {
        _propertiesBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_propertiesBtn setTitle:@"目录" forState:UIControlStateNormal];

    }
    return _propertiesBtn;
}

-(UIButton *)introductionBtn{
    
    if (!_introductionBtn) {
        _introductionBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_introductionBtn setTitle:@"简介" forState:UIControlStateNormal];
        
    }
    return _introductionBtn;
}
-(UIView *)propertiesLine{
    if (!_propertiesLine) {
        _propertiesLine = [[UIView alloc]initWithFrame:CGRectZero];
        _propertiesLine.backgroundColor = [UIColor redColor];
    }
    return _propertiesLine;
}

-(UIView *)introductionLine{
    if (!_introductionLine) {
        _introductionLine = [[UIView alloc]initWithFrame:CGRectZero];
        _introductionLine.backgroundColor = [UIColor redColor];
    }
    return _introductionLine;
}

@end
